package me.ilich.piet.interpreter.commands;

import me.ilich.piet.interpreter.Stack.Context;

public abstract class UnaryCommand implements Command {

	@Override
	public void onExecute(Context context) {
		final int size = context.getStackState().getData().size();
		if(size>=1){
			int a = context.getStackState().getData().get(size-1);
			onUnary(context, a, size);
		}
	}
	
	protected abstract void onUnary(Context context, int a, int size);

}
